import axios from 'axios'
// axios的实例对象
// 1.模拟get请求
axios.get('http://123.207.32.32:8000/home/multidata').then((res) => {
  console.log(res.data)
})
// get请求并且传入参数
axios
  .get('http://httpbin.org/get', {
    params: {
      name: 'coderwhy',
      age: 18
    }
  })
  .then((res) => {
    console.log('22', res.data)
  })

// promise本身是可以有类型的
new Promise<string>((resolve) => {
  resolve('abc')
}).then((res) => {
  console.log('ddd', res.length)
})
